(function($) {        
    /**
     * 
     * @param {type} options
     * @returns {unresolved}
     */
    $.fn.setWord = function(options) {                
        var settings = $.extend({
            text : "default word.",
            color: "green",
            fontStyle: "normal",        
        },options);
        return this.each(function(){
            $(this).text(settings.text);
            $(this).css('color',settings.color);
            $(this).css('font-style',settings.fontStyle);
            $(this).reverseText();
            $(this).highlight();
            //$(this).showLinkLocation();
        });
    };                
    
    /**
     * 
     * @returns {@exp;@call;@call;append}
     */
    $.fn.showLinkLocation = function(){
//        return this.filter("a").each(function(){
//            $(this).append("("+$(this).attr("href")+")");
//        });
        
        return this.filter("a").append("("+$(this).attr("href")+")");
        
    };

    /**
     * 
     * @returns {unresolved}
     */
    $.fn.reverseText = function(){
        return this.each(function(){
            var originalText = $(this).text();
            var newText = '';
            for(var i=originalText.length - 1;i>=0;i--){
                newText += originalText.substr(i,1) ;
            }
            $(this).text(newText);            
        });
    };
    
    
    $.fn.highlight = function(options){
        var settings = $.extend({
            foreground: "red",
            background: "yellow"
        },options);
        
        return this.each(function(){
             $(this).css('color',settings.foreground);
             $(this).css('background-color',settings.background);
        });
        
    };
    
    /**
     * @description :
     * <p> Protecting the $ Alias and Adding Scope</p>
     * <p> and if you're using another library with jQuery, you will have to make jQuery not use the $ with jQuery.noConflict(). However, this will break our plugin since it is written with the assumption that $ is an alias to the jQuery function. To work well with other plugins, and still use the jQuery $ alias, we need to put all of our code inside of an Immediately Invoked Function Expression, and then pass the function jQuery, and name the parameter $ using $.ltrim & $.rtim .</p>
     * @param {type} str
     * @returns {@exp;str@call;replace}
     */       
    $.ltrim = function(str){
        return str.replace(/^\s+/,"");
    };
    
    $.rtrim = function(str){
        return str.replace(/^\s+/,"");
    };
    
}(jQuery));